Remove ruby compat hacks (#259)
authorClaire Foster <aka.c42f@gmail.com>
Thu, 4 Jan 2024 18:01:49 +0000 (04:01 +1000)
committerGitHub <noreply@github.com>
Thu, 4 Jan 2024 18:01:49 +0000 (13:01 -0500)
commit1fe43f5a6d9c628f717c5ec8aeaeae4a9adfd167
treeaf0acd0c05764c3290f3dcaced730d3f81950fb4
parenta78bee90c2b10b3b8ad61abcb69cb61e93b6d9bd
Remove ruby compat hacks (#259)

* Fix two minor bugs from the Ruby code

First, `categroy` rather than `code` was used in constructing the
`control_boundary` property as related to the characters U+200C and
U+200D. This seemed incorrect and should be fixed. This could be an
observable bugfix for any C code which inspects the `control_boundary`
property.

Second, when reading composition exclusions, Ruby's String hex method
produces zero rather than nil if no number is found. For example

    $ ruby -e 'puts "# blah".hex'
    0

This led to the character `'\0'` being included in the `exclusions`
and `excl_versions` sets which is incorrect. However this seems
asymptomatic because `'\0'` is never part of a composition. (In terms of
the C code, the use of `comp_exclusion` is guarded by the `comb_index`
property which is `UINT16_MAX` for `'\0'`.)

* Cleanup: Remove sequence ordering hack

This hack changed the ordering of sequences encoded in the sequences
table and was added so we could easily prove equivalence to the Ruby
data generator code.

However, it's no longer needed and removing it shouldn't result in any
functional change.
data/data_generator.jl
utf8proc_data.c